package com.da.javatest.leetCode;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * @author chenlida
 * @date 2019/1/17 19:44
 * @description
 */
public class Code455 {
    public int findContentChildren(int[] g, int[] s) {
        Arrays.sort(s);
        int total = 0;
        List<Integer> index = new ArrayList<>(1024);
        for (int i : g) {
            for (int j = 0; j < s.length; j++) {
                if (index.contains(j)) {
                    continue;
                }
                if (s[j] >= i) {
                    total++;
                    index.add(j);
                    break;
                }
            }
        }
        return total;
    }
}
